Skip to content

fix: proof chain terminates powerline delegations#36

Closed
frrist wants to merge 1 commit into
mainfrom
frrist/fix/proof-chain
Closed

fix: proof chain terminates powerline delegations#36
frrist wants to merge 1 commit into
mainfrom
frrist/fix/proof-chain

Conversation

@frrist

@frrist frrist commented May 27, 2026

Copy link
Copy Markdown
Member

No description provided.

@frrist frrist requested review from Peeja and alanshaw May 27, 2026 18:42
@frrist frrist self-assigned this May 27, 2026
Comment thread ucan/proof_chain.go
// a subject — common for did:mailto accounts after login).
// The matcher only returns delegations where d.Subject() matches
// sub or is did.Undef, so we only need to check the issuer here.
if d.Issuer() == sub {

@alanshaw alanshaw May 28, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sub should NOT be null here - it is checked by the caller (ProofChain). The matchDelegations function should only be returning delegations with subject == sub or subject == null.

If the subject is the issuer then we are at the root, otherwise we need to keep going.

The change here allows a powerline to be the root delegation, since the delegation returned here MAY have a null subject. This is explicitly not allowed.

Powerline delegations MUST NOT be used as the root delegation to a resource. A priori there is no such thing as a null subject.
https://github.com/ucan-wg/delegation#powerline

Comment thread ucan/proof_chain_test.go
finder := &memLister{delegations: []ucan.Delegation{dlg}}
matcher := ucanlib.NewDelegationMatcher(finder.List)

proofs, links, err := ucanlib.ProofChain(t.Context(), matcher, agent.DID(), cmd, account.DID())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't return anything - we don't have a valid proof chain. Powerline cannot be the root delegation.

@frrist

frrist commented May 28, 2026

Copy link
Copy Markdown
Member Author

Closing this as not needed.

@frrist frrist closed this May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants